<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ include file="/common/index.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>微客服_福利</title>
	<script language="javascript" src="<%=basePath %>/js/jquery-1.7.1.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/css.css">
</head>
<%
	String game_flag = request.getParameter("game_flag");
	String fuli_type = request.getParameter("fuli_type");
	if(game_flag==null ||"".equals(game_flag)){
		game_flag="征途";
	}
	if(fuli_type==null ||"".equals(fuli_type)){
		fuli_type="1";
	}
	
	String phoneNum = (String)request.getAttribute("phoneNum");
	
%>

<body>
	<div class="wrapper">
		<h2><a  onclick="javascript:goBack();" class="spec1"> < </a>福利<a onclick="window.location.href='<%=basePath %>/manager/batchGame/selectMyGameApp.shtml?phoneNum=<%=phoneNum %>&game_flag=<%=game_flag %>&fuli_type=<%=fuli_type %>';" class="spec2">我的福利</a></h2>
		<div class="nav">
			<a game_flag="征途">征途</a>
			<a game_flag="征途2">征途2</a>
			<a game_flag="大主宰">大主宰</a>
			<a game_flag="鲁塔">鲁塔</a>
		</div>
		<div class="menuw">
			<div class="menu">
				<a fuli_type="1">激活码</a>
				<a fuli_type="2">礼包</a>
				<a fuli_type="3">道具</a>
				<a fuli_type="4">周边</a>
			</div>
		</div>
		
		
			<s:if test="dataList.size()>0">
			<div class="content"  >
				<s:iterator value="dataList" status="st">  
				<dl>
					<dt>
						<a href="<%=basePath %>/manager/batchGame/selectVoByIdForApp.shtml?id=<s:property value="id"/>&phoneNum=<%=phoneNum %>&game_flag=<%=game_flag %>&fuli_type=<%=fuli_type %>">
							<img src='<s:property value="imgSrc"/>'>
							<s:set name="nowTime" value="new java.util.Date()"></s:set>
							<s:set name="lessTime" value="endtime"></s:set>
							<s:if test='#lessTime != null && #lessTime.getTime()>#nowTime.getTime()'>
								<p class="p" style="background: #000;">剩余<span><s:property value="ncount-useCount"/></span>个</p>
							</s:if>
							<s:else>
								<p class="p" style="background: #605f65;">已结束</p>
							</s:else>
						</a>
					</dt>
					<dd><s:property value="title"/></dd>
				</dl>
				 </s:iterator>
				
				<div class="clearboth"></div>
			</div>
			</s:if>
			<s:else>
				<div class="content"  style="text-align:center;" >		
					<span >暂无礼包...</span>
				</div>	
			</s:else>
		
		
		
	</div>
</body>
<script language="javascript">
	
	
	//window.setInterval(refPage, 10000);
	
	function refPage(){
		window.location.reload();
	}
	
	$(document).ready(function(){
		$('.nav a[game_flag=<%=game_flag%>]').addClass('cur');
		$('.menu a[fuli_type=<%=fuli_type%>]').addClass('cur');
		
		/*
		$(window).scroll(function(){
           if($(document).scrollTop()>=$(document).height()-$(window).height()){
             	alert(123);
           }
         })
		*/
	         
	});
	
	$('.nav a').bind('click',function(){
		var gf = $(this).attr("game_flag");
		window.location.href='<%=basePath %>/manager/batchGame/selectForApp.shtml?phoneNum=<%=phoneNum %>&game_flag='+gf;
	});
	
	
	$('.menu a').bind('click',function(){
		var ft= $(this).attr("fuli_type");
		window.location.href='<%=basePath %>/manager/batchGame/selectForApp.shtml?phoneNum=<%=phoneNum %>&game_flag=<%=game_flag%>&fuli_type='+ft;
	});
	
	
	function chksys(){
		  if(navigator.userAgent.toLowerCase().indexOf('android') != -1)
		  {
		    return 'Android';
		  }
		  else {
		    iosdevices = new Array('iphone','ipad','ipod','ios');
		    for(var i in iosdevices )
		    {
		      if(navigator.userAgent.toLowerCase().indexOf(iosdevices[i]) != -1)
		      {
		        return 'IOS';
		      }
		    }
		  }
		  return 'unknown';
		}


		

	
	function goBack(){
		switch(chksys())
		  {
		        case 'Android':
		   		   customer.goback();
		   		   break;
		   }
	}
	

</script>
</html>